Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add building blocks dropdown #1251

Merged
merged 13 commits into from
Aug 7, 2024
Merged

Conversation

josh-willis-arcadis
Copy link
Contributor

@josh-willis-arcadis josh-willis-arcadis commented Jul 29, 2024

Implements new building block dropdown component.

Addl discussion at #1241

PR Checklist:

  • Does the code follow accessibility standards (WCAG 2.1 AA Compliant)?
  • Are all languages supported (Internationalization/Localization)?
  • Are appropriate Typescript types implemented?

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good! The css rules are being applied globally, but once those are fixed this should be good to go.

lib/components/user/nav-login-button.css Outdated Show resolved Hide resolved
Comment on lines 41 to 44
const PatternSelectDropdown = styled(Dropdown)`
span,
span.caret {
color: #333;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@daniel-heppner-ibigroup
Copy link
Contributor

The percy tests caught that there's a black border around the dropdown now. Is that expected?
image

@amy-corson-ibigroup
Copy link
Contributor

I noticed this too.... I kinda like it with the metro, and in the route viewer? But it does look a little weird with the old itinerary.

@josh-willis-arcadis
Copy link
Contributor Author

@daniel-heppner-ibigroup @amy-corson-ibigroup I think the border was added by accident tbh. I think it looks great in the route viewer. I will remove the border on the itinerary panel to pass the percy tests.

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're repeating these a lot:

line-height: 20px;
padding: 3px 7px;
  span.caret {
    margin-left: 2px;
  }

IF we think this is what the default dropdown should be, let's go ahead and fix it in building-blocks. But I actually think the new dropdown looks nice and is an improvement! Interested in @daniel-heppner-ibigroup opinion on this too, if we prefer to match the percy tests exactly, that's totally fine. But right now we're setting those styles in one place and immediately overriding them in another.

lib/components/narrative/narrative-itineraries-header.tsx Outdated Show resolved Hide resolved
lib/components/narrative/narrative-itineraries-header.tsx Outdated Show resolved Hide resolved
@@ -149,12 +166,11 @@ class RouteDetails extends Component<Props> {
<HeadsignSelectLabel htmlFor="headsign-selector-label">
<FormattedMessage id="components.RouteDetails.stopsTo" />
</HeadsignSelectLabel>
<SortResultsDropdown
<PatternSelectDropdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to leave the default margins (which would mean a slightly taller dropdown) just flagging it would probably be good to throw an align-items: center on the parent here so that this row doesn't look uneven:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place I really had a problem with the way the new styling looks. If we can get this vertically centered then I'm happy to approve the Percy diff

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look a 78d52eb. This addresses @amy-corson-ibigroup and @daniel-heppner-ibigroup suggestions!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good, I would maybe add some margin-bottom to this div just to add a little vertical space between the selector and the "stops in this direction of travel":
image

Copy link
Contributor Author

@josh-willis-arcadis josh-willis-arcadis Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added here! c51ffba

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks so much for all the changes

@@ -149,12 +166,11 @@ class RouteDetails extends Component<Props> {
<HeadsignSelectLabel htmlFor="headsign-selector-label">
<FormattedMessage id="components.RouteDetails.stopsTo" />
</HeadsignSelectLabel>
<SortResultsDropdown
<PatternSelectDropdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good, I would maybe add some margin-bottom to this div just to add a little vertical space between the selector and the "stops in this direction of travel":
image

@josh-willis-arcadis
Copy link
Contributor Author

@daniel-heppner-ibigroup I think the Percy diff is good to be approved. Let me know if there are any more questions!

@daniel-heppner-ibigroup
Copy link
Contributor

Looks great! Thank you for your hard work here @josh-willis-arcadis

Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@josh-willis-arcadis josh-willis-arcadis merged commit 1e06c30 into dev Aug 7, 2024
9 checks passed
@josh-willis-arcadis josh-willis-arcadis deleted the add-building-blocks-dropdown branch August 7, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants